package com.workerhelping.enums;

import lombok.Getter;

@Getter
public enum RecordStatusEnum {
    UNSUBMITTED(0, "未提交"),
    UNREVIEWED(1, "待审核"),
    APPROVED(2, "已通过"),
    REJECTED(3, "已拒绝"),
    CANCELLED(4, "已注销");


    private final Integer code;
    private final String status;

    RecordStatusEnum(Integer code, String status) {
        this.code = code;
        this.status = status;
    }

    public static String getStatusName(Integer code) {
        if (code == 0)
            return UNSUBMITTED.status;
        else if (code == 1)
            return UNREVIEWED.status;
        else if (code == 2)
            return APPROVED.status;
        else if (code == 3)
            return REJECTED.status;
        else if (code == 4)
            return CANCELLED.status;
        else return null;
    }
}
